/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jdbcfox;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

/**
 *
 * @author avbravo
 */
public class CopiarFicheros {

    public Boolean copiar(String fuente, String destino) {
        try {
//        Path source = Paths.get("C:\\My Documents\\Stuff.txt");
//        Path target = Paths.get("D:\\Backup\\MyStuff.txt");
//         Path source = Paths.get("/home/avbravo/Monica85/emp_1011/empresas.dbf");
//        Path target = Paths.get("/home/avbravo/Documentos/empresas.dbf");

            Path source = Paths.get(fuente);
            Path target = Paths.get(destino);
            Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING);
            return true;
        } catch (Exception ex) {
            System.out.println(" " + ex.getLocalizedMessage());
        }
        return false;
    }
}
